import request from '@/config/axios'

export interface ManufacturingPartsListTaskVO {
  id: number
  taskNumber: string
  completionOrChangeNumber: string
  productNumber: string
  productName: string
  drawingNumber: string
  specification: string
  partName: string
  taskType: number
  status: number
  version: string
  activeData: Date
  stopData: Date
  userNickName: string
  enableTime:Date,
  stopTime:Date
}

// 查询制造件清单列表
export const getManufacturingPartsListTaskPage = async (params) => {
  return await request.get({ url: `/config/manufacturing-parts-list-task/page`, params })
}

// 查询制造件清单任务单详情
export const getManufacturingPartsListTask = async (id: number) => {
  return await request.get({ url: `/config/manufacturing-parts-list-task/get?id=` + id })
}

// 新增制造件清单任务单
export const createManufacturingPartsListTask = async (data: ManufacturingPartsListTaskVO) => {
  return await request.post({ url: `/config/manufacturing-parts-list-task/create`, data })
}

// 修改制造件清单任务单
export const updateManufacturingPartsListTask = async (data: ManufacturingPartsListTaskVO) => {
  return await request.put({ url: `/config/manufacturing-parts-list-task/update`, data })
}

// 删除制造件清单任务单
export const deleteManufacturingPartsListTask = async (id: number) => {
  return await request.delete({ url: `/config/manufacturing-parts-list-task/delete?id=` + id })
}

// 导出制造件清单列表
export const exportManufacturingPartsListTask = async (params) => {
  return await request.download({ url: `/config/manufacturing-parts-list-task/export-excel`, params })
}
// 导出制造件清单任务单详情 Excel
export const exportManufacturingPartsListTaskDetail = async (params) => {
  return await request.download({ url: `/config/manufacturing-parts-list-task/export-task-details-excel`, params })
}
//制造清单任务单编辑保存
export const savedata = async (data) => {
  return await request.post({url:`/config/manufacturing-parts-list-task-details/edit-save`,data})
}
//制造清单任务单编辑提交
export const submitdata = async (data) => {
  return await request.post({url:`/config/manufacturing-parts-list-task-details/edit-submit`,data})
}
//制造清单任务单详情列表数据
export const getDetail = async (id: number) => {
  return await request.get({ url: `/config/manufacturing-parts-list-task/edit?id=` + id })
}
//制造清单任务单完成
export const completeData = async (params) => {
  return await request.post({ url: `/config/manufacturing-parts-list-task/save`,params})
}
//变更保存
export const changeSavedata = async (data) => {
  return await request.post({url:`/config/manufacturing-parts-list-task-details/change-save`,data})
}
//变更提交
export const changeSubmitdata = async (data) => {
  return await request.post({url:`/config/manufacturing-parts-list-task-details/change-submit`,data})
}
//批量删除
export const deleteSelect = async (id) => {
  
  return await request.delete({ url: `/config/manufacturing-parts-list-task-details/deletes`,data:id})
}